home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Shareware / Auslogics BoostSpeed 4.2.7.172 / boost-speed-setup.exe / {app} / OneButtonCheckup.exe / 0 / TEMPLATES / DC_REPORT_TEMPLATE next >
Extensible Markup Language  |  2008-10-30  |  12KB  |  277 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4.   <xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01//EN" encoding="utf-8" />
  5.  
  6.   <xsl:decimal-format name="decimal-format" decimal-separator="." grouping-separator="," />
  7.   
  8.   <xsl:variable name="failed_status" select="'%STATUS_FAILED%'"/>
  9.  
  10.   <xsl:template match="/">
  11.     <html>
  12.       <head>
  13.         <title>Auslogics Disk Cleaner Report</title>
  14.         <style type="text/css">
  15.           .note { BACKGROUND-COLOR:  #ffffff; COLOR: #0066DD; FONT-FAMILY: "Verdana", sans-serif; FONT-SIZE: 100%; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 0px;MARGIN-TOP: 0px; PADDING-RIGHT: 10px}
  16.           .infotable { BACKGROUND-COLOR: #f0f0e0; BORDER-BOTTOM: #ffffff 0px solid; BORDER-COLLAPSE: collapse; BORDER-LEFT: #ffffff 0px solid; BORDER-RIGHT: #ffffff 0px  solid; BORDER-TOP: #ffffff 0px solid; BORDER-COLOR:white; FONT-SIZE: 70%; MARGIN-LEFT: 10px }
  17.           .header { BACKGROUND-COLOR: #cecf9c; BORDER-BOTTOM: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #ffffff 1px solid;  BORDER-TOP: #ffffff 1px solid; COLOR: #000000; FONT-WEIGHT: bold }
  18.           .content { BACKGROUND-COLOR: #e7e7ce; BORDER-BOTTOM: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #ffffff 1px solid;     BORDER-TOP: #ffffff 1px solid;  PADDING-LEFT: 3px }
  19.           .failed_content { BACKGROUND-COLOR: #e7e7ce; PADDING-LEFT: 3px }
  20.           .foot-r { BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; text-align:right; padding-right:10px;}
  21.           .foot-l { BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; text-align:left; padding-left:10px;}
  22.           .beforeline { BACKGROUND-COLOR: red;  COLOR: red; }
  23.           .afterline { BACKGROUND-COLOR: green;  COLOR: green; }
  24.           H1 { BACKGROUND-COLOR: #003366; BORDER-BOTTOM: #336699 6px solid; COLOR: #ffffff; FONT-SIZE: 130%; FONT-WEIGHT: normal; MARGIN: 0em 0em 0em -20px; PADDING-BOTTOM: 8px;  PADDING-LEFT: 30px; PADDING-TOP: 16px }
  25.           H2 { COLOR: #000000; FONT-SIZE: 80%; FONT-WEIGHT: bold; MARGIN-BOTTOM: 3px; MARGIN-LEFT: 10px; MARGIN-TOP: 20px; PADDING-RIGHT: 20px }
  26.           P { FONT-FAMILY: "Verdana", sans-serif; FONT-SIZE: 70%; LINE-HEIGHT: 12pt; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 10px; MARGIN-TOP: 10px}
  27.           BODY { BACKGROUND-COLOR: white; FONT-FAMILY: "Verdana", sans-serif; FONT-SIZE: 100%; MARGIN-LEFT: 0px;     MARGIN-TOP: 0px }
  28.           A:link { COLOR: #336699; TEXT-DECORATION: underline }
  29.           A:visited { COLOR: #336699; }
  30.           A:active { COLOR: #336699; }
  31.           A:hover { COLOR: #003366; TEXT-DECORATION: underline }
  32.         </style>
  33.       </head>
  34.       <body>
  35.         <h1>%HEADER_TITLE%</h1>
  36.         <table align="center" width="100%" border="0">
  37.           <tr>
  38.             <td>
  39.               <p>
  40.                 <span class="note">
  41.                   <b>%HEADER_TIME% </b> <xsl:value-of select="/report/info/reportTime"/>
  42.                 </span>
  43.               </p>
  44.               <p>
  45.                 <h2>
  46.                   %HEADER_USER% "<xsl:value-of select="/report/info/user"/>"
  47.                 </h2>
  48.               </p>
  49.             </td>
  50.           </tr>
  51.           <tr>
  52.             <td>
  53.               <table align="center" cellpadding="2" cellspacing="0" width="100%" border="1" bordercolor="white" class="infotable">
  54.                 <!--Summary-->
  55.                 <tr>
  56.                   <td colspan="2" class="header">
  57.                     %HEADER_SUMMARY%
  58.                   </td>
  59.                 </tr>
  60.                 <tr>
  61.                   <td class="content" width="40%">
  62.                     <br/>
  63.                   </td>
  64.                   <td class="content">
  65.                     <br/>
  66.                   </td>
  67.                 </tr>
  68.                 <tr>
  69.                   <td class="foot-r">
  70.                     %HEADER_PROCESSED%
  71.                   </td>
  72.                   <td class="foot-l">
  73.                     <xsl:value-of select="/report/scanlog/processed"/>
  74.                   </td>
  75.                 </tr>
  76.                 <tr>
  77.                   <td class="foot-r">
  78.                     %HEADER_FOUND%
  79.                   </td>
  80.                   <td class="foot-l">
  81.                     <xsl:value-of select="/report/scanlog/found"/>
  82.                   </td>
  83.                 </tr>
  84.                 <tr>
  85.                   <td class="foot-r">%HEADER_REMOVED%</td>
  86.                   <td class="foot-l">
  87.                     <xsl:value-of select="/report/scanlog/removed"/>
  88.                   </td>
  89.                 </tr>
  90.                 <tr>
  91.                   <td class="foot-r">%HEADER_FAILED%</td>
  92.                   <td class="foot-l">
  93.                     <xsl:value-of select="/report/scanlog/failed"/>
  94.                   </td>
  95.                 </tr>
  96.                 <tr>
  97.                   <td class="foot-r">%HEADER_STARTED%</td>
  98.                   <td class="foot-l">
  99.                     <xsl:value-of select="/report/scanlog/started"/>
  100.                   </td>
  101.                 </tr>
  102.                 <tr>
  103.                   <td class="foot-r">%HEADER_FINISHED%</td>
  104.                   <td class="foot-l">
  105.                     <xsl:value-of select="/report/scanlog/finished"/>
  106.                   </td>
  107.                 </tr>
  108.                 <tr>
  109.                   <td class="foot-r">%HEADER_ELAPSED%</td>
  110.                   <td class="foot-l">
  111.                     <xsl:call-template name="formatTime">
  112.                       <xsl:with-param name="time" select="/report/scanlog/elapsed" />
  113.                     </xsl:call-template>
  114.                   </td>
  115.                 </tr>
  116.                 <tr>
  117.                   <td class="foot-r">
  118.                     <b>
  119.                       %HEADER_TOTAL_SIZE%
  120.                     </b>
  121.                   </td>
  122.                   <td class="foot-l">
  123.                     <span class="beforeline">
  124.                       <xsl:call-template name="drawGraph">
  125.                         <xsl:with-param name="x" select="0"/>
  126.                         <xsl:with-param name="size" select="/report/scanlog/totalsize"/>
  127.                       </xsl:call-template>
  128.                     </span>
  129.                     <xsl:text>
  130.                     </xsl:text>
  131.                     <xsl:value-of select="/report/scanlog/totalsize_str"/>
  132.                     <xsl:text> (</xsl:text>
  133.                     <xsl:value-of select="format-number(/report/scanlog/totalsize div /report/scanlog/totalsize, '0.0#%', 'decimal-format')"/>
  134.                     <xsl:text>)</xsl:text>
  135.                   </td>
  136.                 </tr>
  137.                 <tr>
  138.                   <td class="foot-r">
  139.                     <b>
  140.                       %HEADER_SIZE_FREED%
  141.                     </b>
  142.                   </td>
  143.                   <td class="foot-l">
  144.                     <span class="afterline">
  145.                       <!--Draw fragmentation graph-->
  146.                       <xsl:call-template name="drawGraph">
  147.                         <xsl:with-param name="x" select="0"/>
  148.                         <xsl:with-param name="size" select="/report/scanlog/sizediff"/>
  149.                       </xsl:call-template>
  150.                     </span>
  151.                     <xsl:text>
  152.                     </xsl:text>
  153.                     <xsl:value-of select="/report/scanlog/sizediff_str"/>
  154.                     <xsl:text> (</xsl:text>
  155.                     <xsl:value-of select="format-number(/report/scanlog/sizediff div /report/scanlog/totalsize, '0.0#%', 'decimal-format')"/>
  156.                     <xsl:text>)</xsl:text>
  157.                   </td>
  158.                 </tr>
  159.                 <tr height="10px">
  160.                   <td colspan="2" class="foot-r">
  161.                     <br/>
  162.                   </td>
  163.                 </tr>
  164.               </table>
  165.             </td>
  166.           </tr>
  167.  
  168.           <!--Categories-->
  169.           <xsl:for-each select="/report/cleanLog/sections/section">
  170.             <xsl:if test="count(items/item) > 0">
  171.               <tr>
  172.                 <td>
  173.                   <table align="center" cellpadding="2" cellspacing="0" width="100%" border="1" bordercolor="white" class="infotable">
  174.                     <tr class="header">
  175.                       <td colspan="3">
  176.                         %SECTION_HEADER%
  177.                         <xsl:value-of select="name"/>
  178.                       </td>
  179.                     </tr>
  180.                     <tr class="content">
  181.                       <td width="60%">%COLUMN_FILE%</td>
  182.                       <td width="25%">%COLUMN_DESC%</td>
  183.                       <td width="15%">%COLUMN_STATUS%</td>
  184.                     </tr>
  185.                     <xsl:for-each select="items/item">
  186.                       <tr class="foot-l">
  187.                         <td>
  188.                           <xsl:if test="status = $failed_status">
  189.                             <xsl:attribute name="class">
  190.                               failed_content
  191.                             </xsl:attribute>
  192.                           </xsl:if>
  193.                           <xsl:value-of select="location"/>
  194.                           <xsl:if test="value != ''">,
  195.                             <xsl:value-of select="value"/>
  196.                           </xsl:if>
  197.                         </td>
  198.                         <td>
  199.                           <xsl:if test="status = $failed_status">
  200.                             <xsl:attribute name="class">
  201.                               failed_content
  202.                             </xsl:attribute>
  203.                           </xsl:if>
  204.                           <xsl:value-of select="description"/>
  205.                         </td>
  206.                         <td>
  207.                           <xsl:if test="status = $failed_status">
  208.                             <xsl:attribute name="class">
  209.                               failed_content
  210.                             </xsl:attribute>
  211.                           </xsl:if>
  212.                           <xsl:value-of select="status"/>
  213.                           <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
  214.                         </td>
  215.                       </tr>
  216.                     </xsl:for-each>
  217.                   </table>
  218.                 </td>
  219.               </tr>
  220.               <tr height="10px"/>
  221.             </xsl:if>
  222.           </xsl:for-each>
  223.  
  224.           <tr>
  225.             <td>
  226.               <hr align="center" width="100%"/>
  227.               <p>
  228.                 <span class="note">
  229.                     <b>%FOOTER_USER_BEGIN% "<xsl:value-of select="/report/info/user"/>" %FOOTER_USER_END%</b>
  230.                   </span>                
  231.               </p>
  232.             </td>
  233.           </tr>
  234.         </table>
  235.       </body>
  236.     </html>
  237.   </xsl:template>
  238.  
  239.   <xsl:template name="drawGraph">
  240.     <!--This template draws a error rate graph-->
  241.     <xsl:param name="x" select="0" />
  242.     <xsl:param name="size" select="0" />
  243.     <xsl:variable name="before" select="/report/scanlog/totalsize" />
  244.     <xsl:variable name="after" select="$size" />
  245.     <xsl:if test="$x < 50 * $after div $before">
  246.       <xsl:text>|</xsl:text>
  247.       <xsl:call-template name="drawGraph">
  248.         <xsl:with-param name="x" select="$x + 1"/>
  249.         <xsl:with-param name="size" select="$size"/>
  250.       </xsl:call-template>
  251.     </xsl:if>
  252.   </xsl:template>
  253.  
  254.   <xsl:template name="formatTime">
  255.     <xsl:param name="time" select="'01:02:03.4'" />
  256.     <xsl:variable name="h" select="format-number(substring($time,1,2),'0')"/>
  257.     <xsl:variable name="m" select="format-number(substring($time,4,2),'0')"/>
  258.     <xsl:variable name="s" select="format-number(substring($time,7,2),'0')"/>
  259.     <xsl:if test="number($h) > 0">
  260.       <xsl:value-of select="$h"/>
  261.       %TIME_HOURS%
  262.     </xsl:if>
  263.     <xsl:if test="number($m) > 0">
  264.       <xsl:value-of select="$m"/>
  265.       %TIME_MINUTES%
  266.     </xsl:if>
  267.     <xsl:if test="number($s) > 0">
  268.       <xsl:value-of select="$s"/>
  269.       %TIME_SECONDS%
  270.     </xsl:if>
  271.     <xsl:if test="(number($h) = 0) and (number($m) = 0) and (number($s) = 0)">
  272.       %TIME_LESS%
  273.     </xsl:if>
  274.   </xsl:template>
  275.  
  276. </xsl:stylesheet>
  277.